package com.icode50.spring.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

/**
 * 数据库实体
 * @author allenlin
 * 指定字段不返回：@JsonIgnore
 * 指定日期格式：@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",locale="zh",timezone="GMT+8")
 * 空字段不返回：@JsonInclude(Include.NON_NULL)
 * 指定别名：@JsonProperty
 */
public class User {

    private Integer userId;

    private String userName;

    private String password;

    private String telephone;

    @JsonInclude(Include.NON_NULL)
    private Integer gender;

    private String job;
    
    @JsonInclude(Include.NON_NULL)
    private Integer age;

    @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",locale="zh",timezone="GMT+8")
	private Date createTime;
    
    public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }
    
	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getGender() {
		return gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@Override
	public String toString() {
		return "User [userId=" + userId + ", userName=" + userName + ", password=" + password + ", telephone="
				+ telephone + ", gender=" + gender + ", job=" + job + ", age=" + age + ", createTime=" + createTime
				+ "]";
	}

	public User(Integer userId, String userName, String password, String telephone, Integer gender, String job,
			Integer age, Date createTime) {
		super();
		this.userId = userId;
		this.userName = userName;
		this.password = password;
		this.telephone = telephone;
		this.gender = gender;
		this.job = job;
		this.age = age;
		this.createTime = createTime;
	}

	public User() {
	}
}